This package defines several useful constants having to with numbers.
The following parameters have to do with floating-point numbers. This package determines their values by exercising the computer's floating-point arithmetic in various ways. Because this operation might be slow, the code for initializing them is kept in a separate function that must be called before the parameters can be used.
This function makes sure that the Common Lisp floating-point parameters like
most-positive-floathave been initialized. Until it is called, these parameters will benil. If this version of Emacs does not support floats, the parameters will remainnil. If the parameters have already been initialized, the function returns immediately.The algorithm makes assumptions that will be valid for most modern machines, but will fail if the machine's arithmetic is extremely unusual, e.g., decimal.
Since true Common Lisp supports up to four different
floating-point precisions, it has families of constants like
most-positive-single-float,
most-positive-double-float,
most-positive-long-float, and so on. Emacs has only
one floating-point precision, so this package omits the precision
word from the constants' names.
This constant equals the largest value a Lisp float can hold. For those systems whose arithmetic supports infinities, this is the largest finite value. For IEEE machines, the value is approximately
1.79e+308.
This constant equals the most-negative value a Lisp float can hold. (It is assumed to be equal to
(- most-positive-float).)
This constant equals the smallest Lisp float value greater than zero. For IEEE machines, it is about
4.94e-324if denormals are supported or2.22e-308if not.
This constant equals the smallest normalized Lisp float greater than zero, i.e., the smallest value for which IEEE denormalization will not result in a loss of precision. For IEEE machines, this value is about
2.22e-308. For machines that do not support the concept of denormalization and gradual underflow, this constant will always equalleast-positive-float.
This constant is the negative counterpart of
least-positive-normalized-float.